package com.baizhi.service.impl;

import com.baizhi.entity.Admin;
import com.baizhi.service.AdminService;
import com.baizhi.dao.AdminDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminDao adminDao;
    @Override
    public Admin login(String name, String password) {
       Admin admin= adminDao.selectAdminByName(name);
        System.out.println(admin+"=========adminService"+name);
       if(admin!=null&&password.equals(admin.getAdminPassword())){
           return admin;
       }else {
           return null;
       }
    }
}
